var _ = require("lodash");
// _.partition(collection, [predicate=_.identity])
// 创建一个分成两组的元素数组，第一组包含断言为真的元素，第二组包含断言为假的元素

var users = [
  { user: "barney", age: 36, active: false },
  { user: "fred", age: 40, active: true },
  { user: "pebbles", age: 1, active: false },
];
let a = _.partition(users, function (o) {
  return o.active;
});
// console.log(a);

let b = _.partition(users, { age: 1, active: false });
console.log(b);
